package PlaneGame.CODE;
import static PlaneGame.CODE.GameFrame.*;
public abstract class AutoMove extends GameImage{
    int speed;
    public AutoMove() {
        super();
    }
    @Override
    void change() {
        super.change();
        touch();
        move();
    }
    void touch(){
        if(speed>0&&y>frameHeight){
            off();
        } else if (speed<0&&y<0) {
            off();
        }
    }
    void move(){
        y+=speed;
    }
    void effect(){
        off();
    }
}
